(* Content-type: application/vnd.wolfram.mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Mathematica 8.0' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       157,          7]
NotebookDataLength[     23018,        568]
NotebookOptionsPosition[     21375,        512]
NotebookOutlinePosition[     21720,        527]
CellTagsIndexPosition[     21677,        524]
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{

Cell[CellGroupData[{
Cell[TextData[StyleBox["PneumaticMachine",
 FontFamily->"System"]], "Section",
 Evaluatable->False,
 CellChangeTimes->{{3.52488616965088*^9, 3.5248861799318666`*^9}, {
  3.577956172776149*^9, 3.5779561799815607`*^9}, {3.6266093169340982`*^9, 
  3.626609318892098*^9}, {3.626685959947085*^9, 3.6266859663050847`*^9}}],

Cell[BoxData[
 RowBox[{"<<", "C:\\\\Hopsan\\Compgen\\CompgenNG.mx"}]], "Input",
 CellChangeTimes->{{3.5772037650720577`*^9, 3.5772037650780582`*^9}, {
  3.611474457184202*^9, 3.611474523938877*^9}, {3.6114745588913717`*^9, 
  3.61147456057154*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"path", "=", 
   RowBox[{"ToFileName", "[", 
    RowBox[{"{", 
     RowBox[{
     "\"\<C:\>\"", ",", "\"\<HopsanTrunk\>\"", ",", 
      "\"\<ComponentLibraries\>\"", ",", "\"\<defaultLibrary\>\"", ",", 
      "\"\<Pneumatic\>\""}], "}"}], "]"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.5757727777685804`*^9, 3.575772792541806*^9}, {
   3.5757728423954945`*^9, 3.5757728498367076`*^9}, {3.57577333888545*^9, 
   3.5757733706315055`*^9}, 3.5757734316206255`*^9, 3.6031909973287797`*^9, 
   3.6057717887213297`*^9, {3.605771829393656*^9, 3.605771830929744*^9}, 
   3.6058530990363216`*^9, {3.621138851005574*^9, 3.621138863716845*^9}, {
   3.626686112671085*^9, 3.6266861209310846`*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"domain", "=", "\"\<Pneumatic\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"displayName", "=", "\"\<Machine\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"brief", "=", "\"\<This is a pump/motor with an inertia load\>\""}],
   ";"}], "\n", 
 RowBox[{
  RowBox[{"componentType", "=", "\"\<ComponentQ\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"author", "=", "\"\<Petter Krus <petter.krus@liu.se>\>\""}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
  "affiliation", " ", "=", " ", 
   "\"\<Division of Fluid and Mechatronic Systems, Link\[ODoubleDot]ping \
University\>\""}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"SetFilenames", "[", 
   RowBox[{"path", ",", "domain", ",", "displayName"}], "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"ResetComponentVariables", "[", "]"}], ";"}]}], "Input",
 CellChangeTimes->{{3.5137112151875*^9, 3.513711217109375*^9}, {
   3.51378596903125*^9, 3.513785980671875*^9}, 3.515394539753217*^9, {
   3.515775693875*^9, 3.5157757050625*^9}, {3.517048046727305*^9, 
   3.51704806093043*^9}, 3.51707206725*^9, {3.5176530686834764`*^9, 
   3.51765311057437*^9}, {3.517673126703125*^9, 3.517673126796875*^9}, {
   3.5177214423487377`*^9, 3.517721453114225*^9}, {3.5177222281793466`*^9, 
   3.517722236008023*^9}, {3.5209603293125*^9, 3.520960329578125*^9}, 
   3.521782180515625*^9, {3.52178222675*^9, 3.521782271609375*^9}, {
   3.521782314984375*^9, 3.52178231528125*^9}, 3.5248861854161005`*^9, 
   3.5757721184092045`*^9, {3.577957012447175*^9, 3.5779570270120087`*^9}, {
   3.6266042212263517`*^9, 3.626604223226552*^9}, {3.6266859740020847`*^9, 
   3.626685987184085*^9}}],

Cell[TextData[{
 "Pneumatic machine that can be used as compressor and motor\n\n",
 Cell[GraphicsData["Metafile", "\<\
CF5dJ6E]HGAYHf4PEfU^I6mgLb15CDHPAVmbKF5d0@0000F<0@000?@0003JoOoof_gooeH2001h0P00
00000000003N2@00CP/00215CDH00040S0D004<000030000@`0006`000000000EPD00003003R0@00
3`40000000000000000006IJ1`1E8P@0B@1^06/0L`1S0640L01U0200<00^03@0>00^0380801b03T0
>00a03T0800X0440M@1W0200<@0d0200<P0`0340<@0Y0000J@1^06/0L`1S0640L01U02d0H`1/06T0
L01R06l0H@1b06@0;@1U07P0L01_0780M00^06D0K@1V000000000140000<0000200000T0000@0000
gPT004h;000;0000400004L0001B0000AP0002P0000L0000Df=bIFE^?C4c=SIh=cHhL7P/83@h<WPb
=c5]KDH0000/00007@0004AbHGMYKVLm<2h`N30^<71h;20]<2h`N30^<6e]00009`0001P000010000
00000?ooo`0000009@0000`0000100004`0000`000020000G`0003P000020000>0000000000h0000
0000000Q0@0Z0000000000000000000000000000000U000030000080000j000030000>h0000k0000
200001/0000@00005@0000X5000f000040000444000:1@00=P0001000011100090H003H0000@0000
5@0002@6000m0000200003`000080000?`0001P0003JoOooo_goodH2001D0P009@0000`000000020
:00000`0000100009@0000`000070020:00000`0000200009`0001P00002000000000?ooo`000000
9@0000`0000200004`0000`000020000G`0003P000010000>0000000000h0000000000000@0Z0000
000000000000000000000000000U000030000040000Z0000600006<300220P00YPT00<<8000U0000
30000000080X000030000080000U0000300000L0080X000030000040001O0000>0000040000h0000
000003P000000000024102X0000000000000000000000000000002D0000<00000@0003X0000<0000
kP0003/0000800006`000100002F1P00>@/003H0000@0000UPH00?@8000l000020000400000H0000
2?kooa[noomF0P00N08002D0000<00001`00P2P0000<00000@0005l0000h00000@0003P000000000
>000000000008@40:P0000000000000000000000000000009@0000`000010000>P0000`0003^0000
>`0000P0000K0000400009H6001b0P00=P000100002F1P005@0003`000080000@00001P00008o_oo
f_gooeH2000i0P009@0000`000070020:00000`000010000G`0003P000010000>0000000000h0000
0000000R0@0Z0000000000000000000000000000000U000030000040000j0000300001X1000k0000
200001/0000@0000U`H00882000f000040000;T5000>1000=P000100001j1`003`@003d000080000
?00000P0001000006000073noomIo_ook`400=H1000U0000300000L0080X000030000040000>0000
50000000000@00005000
\>"], "Graphics",
  GeneratedCell->False,
  CellAutoOverwrite->False,
  ImageSize->{162., 185.87368421052622`},
  ImageMargins->{{0, 0}, {0, 78}}]
}], "Text",
 CellChangeTimes->{{3.6327783431272955`*^9, 3.6327783663736253`*^9}, {
  3.6327784427429934`*^9, 3.632778451593499*^9}}],

Cell[CellGroupData[{

Cell["Component description", "Subsection"],

Cell["Piston with an inertia load", "Text"]
}, Open  ]],

Cell[CellGroupData[{

Cell["Component equations", "Subsection"],

Cell["The name of the component  is stored in ComponentName.", "Text"]
}, Open  ]],

Cell[CellGroupData[{

Cell["Variables and parameters", "Subsection"],

Cell[BoxData[
 RowBox[{
  RowBox[{"inputParameters", "  ", "=", " ", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"Dm", ",", 
       RowBox[{"50.", " ", 
        SuperscriptBox["10", 
         RowBox[{"-", "6"}]]}], ",", "double", ",", "\"\<m3\>\"", ",", 
       "\"\<Displacement\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "Cim", ",", "0.", ",", "double", ",", "\"\<m3/(s Pa)\>\"", ",", 
       "\"\<Leak coeff.\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "Bm", ",", "0.", ",", "double", ",", "\"\<N/m/s\>\"", ",", 
       "\"\<Visc. friction coeff.\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "Jm", ",", ".1", ",", "double", ",", "\"\<kg/m2\>\"", ",", 
       "\"\<Moment of inertia\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "R", ",", "287.", ",", "double", ",", "\"\<J/Kg K\>\"", ",", 
       "\"\<Gas constant\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "cv", ",", "718", ",", "double", ",", "\"\<J/Kg K\>\"", ",", 
       "\"\<heatcoeff\>\""}], "}"}]}], "\n", "\t", "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.524850755625*^9, 3.524850755640625*^9}, {
   3.577956201851812*^9, 3.577956272255839*^9}, 3.5779573492194376`*^9, {
   3.5779654805065203`*^9, 3.5779655140924416`*^9}, {3.626604316855914*^9, 
   3.626604346530881*^9}, {3.626609330254098*^9, 3.626609351988098*^9}, {
   3.6266093905780983`*^9, 3.626609391313098*^9}, 3.626686533536085*^9, {
   3.6273763898356056`*^9, 3.6273763905156193`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"nodeConnections", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"PneumaticQnode", "[", 
      RowBox[{"p1", ",", "100000.", ",", "\"\<fluid port 1\>\""}], "]"}], ",",
      "\[IndentingNewLine]", 
     RowBox[{"PneumaticQnode", "[", 
      RowBox[{"p2", ",", "100000.", ",", "\"\<fluid port 2\>\""}], "]"}], ",",
      "\[IndentingNewLine]", 
     RowBox[{"MechanicRotQnode", "[", 
      RowBox[{
      "mr1", ",", "0.", ",", "0.", ",", "\"\<Mechanical rot.connection\>\""}],
       "]"}]}], "\[IndentingNewLine]", "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.4458567530827656`*^9, 3.445856805848053*^9}, {
   3.516293489375*^9, 3.516293499125*^9}, {3.535541977*^9, 
   3.535541991625*^9}, {3.535542208609375*^9, 3.5355422090625*^9}, {
   3.535542381671875*^9, 3.535542392828125*^9}, {3.5684503752639694`*^9, 
   3.568450377478191*^9}, {3.5684509832627635`*^9, 3.5684509970240593`*^9}, {
   3.5684511449390593`*^9, 3.568451145238059*^9}, {3.5721614930495863`*^9, 
   3.572161494468728*^9}, {3.6266868208150845`*^9, 3.626686835350085*^9}, {
   3.6268133298169723`*^9, 3.6268133323251157`*^9}, 3.6289544881207824`*^9}]
}, Open  ]],

Cell[CellGroupData[{

Cell["The system of equations", "Subsection"],

Cell["The generated piston force", "Text"],

Cell[BoxData[
 RowBox[{
  RowBox[{"torg", " ", "=", 
   RowBox[{
    FractionBox[
     RowBox[{" ", "Dm"}], 
     RowBox[{"2", " ", "pi"}]], 
    RowBox[{"(", " ", 
     RowBox[{"pp1", " ", "-", "  ", "pp2"}], ")"}]}]}], ";"}]], "Input",
 CellChangeTimes->{{3.52178209578125*^9, 3.52178209959375*^9}, {
   3.577956496099642*^9, 3.5779565177508802`*^9}, 3.6266866274850845`*^9, 
   3.6266866663150845`*^9}],

Cell["The  vector of independent variables of the system are", "Text",
 CellChangeTimes->{{3.524850810625*^9, 3.52485083609375*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"T0", "=", "1."}], ";"}]], "Input",
 CellChangeTimes->{{3.626812221617587*^9, 3.626812224263738*^9}, {
   3.627320756281715*^9, 3.6273207646627264`*^9}, 3.6327784734767513`*^9}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"rho1", " ", ":=", " ", 
   FractionBox["pp1", 
    RowBox[{"R", " ", 
     RowBox[{"(", 
      RowBox[{"Tp1", "+", "T0"}], ")"}]}]]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"rho2", " ", ":=", 
   FractionBox["pp2", 
    RowBox[{"R", " ", 
     RowBox[{"(", "Tp2", ")"}]}]]}], ";"}]}], "Input",
 CellChangeTimes->{{3.6266088064128294`*^9, 3.62660883322651*^9}, {
   3.626609101625098*^9, 3.626609103327098*^9}, {3.626609139173098*^9, 
   3.6266091407110977`*^9}, 3.6267892234901233`*^9, {3.6268121815802965`*^9, 
   3.6268122176613607`*^9}, {3.626813003248294*^9, 3.626813007331527*^9}, 
   3.626854397562913*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"q2", "=", 
   RowBox[{"rho2", " ", "qmp2"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.6268543218415823`*^9, 3.6268543278769274`*^9}, 
   3.6268543892024345`*^9, 3.6268544626146336`*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"qmp1e", "=", 
   RowBox[{"-", "qmp2"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.6273206168895187`*^9, 3.6273206234015274`*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"pi", "=", 
  RowBox[{"N", "[", 
   RowBox[{"Pi", ",", "7"}], "]"}]}]], "Input",
 CellChangeTimes->{{3.626789192284003*^9, 3.626789205688343*^9}}],

Cell[BoxData["3.14159265358979323846264338327950419993`7."], "Output",
 CellChangeTimes->{{3.6267892082005944`*^9, 3.6267892266004343`*^9}, 
   3.626789303937167*^9, 3.6268117782282267`*^9, 3.6268122286019864`*^9, 
   3.6268124176187973`*^9, {3.6268127639866085`*^9, 3.626812772161076*^9}, 
   3.6268133467289395`*^9, 3.6268534696498394`*^9, 3.626853520211731*^9, 
   3.6268537614425287`*^9, 3.626854079529722*^9, 3.6268547440737324`*^9, 
   3.6268555160978894`*^9, 3.62723499605375*^9, 3.6272359239468226`*^9, 
   3.627236608823995*^9, 3.6277328709299912`*^9, 3.62773294889275*^9, 
   3.627733093765172*^9, 3.628703912210665*^9, 3.628705436733282*^9, 
   3.628942012246914*^9, 3.628942055403041*^9, 3.6289545652268915`*^9, 
   3.6289630190863895`*^9, 3.6309144977011323`*^9, 3.6309313517441964`*^9, 
   3.6309980888823423`*^9}]
}, Open  ]],

Cell[BoxData[
 RowBox[{
  RowBox[{"localExpressions", " ", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{"cp", "==", 
     RowBox[{"cv", "+", "R"}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{
  3.4458556656834745`*^9, {3.535528705078125*^9, 3.5355287096875*^9}, {
   3.572017731163913*^9, 3.5720178003058677`*^9}, {3.6266954587713203`*^9, 
   3.6266954813855815`*^9}, {3.6266956813155727`*^9, 
   3.6266957169681373`*^9}, {3.626695850528492*^9, 3.626695939328371*^9}, {
   3.6267882846603336`*^9, 3.626788286066334*^9}, {3.626789293137087*^9, 
   3.626789300793853*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"dEp1", "\[Equal]", 
   RowBox[{
    RowBox[{"qmp1e", " ", "cv", 
     RowBox[{"(", 
      RowBox[{
       RowBox[{
        RowBox[{"onNegative", "[", "qmp1e", "]"}], " ", "Tp1"}], "+", 
       RowBox[{
        RowBox[{"onPositive", "[", "qmp1e", "]"}], " ", "Tp2"}]}], ")"}]}], 
    "-", 
    RowBox[{
     RowBox[{"onPositive", "[", "qmp1e", "]"}], 
     FractionBox["Dm", 
      RowBox[{"2", " ", "pi"}]], " ", 
     RowBox[{"(", "wm1", ")"}], " ", 
     RowBox[{"(", 
      RowBox[{"pp1", "-", "pp2"}], ")"}]}]}]}], ",", 
  RowBox[{"dEp2", "\[Equal]", 
   RowBox[{
    RowBox[{"qmp2", " ", "cv", 
     RowBox[{"(", 
      RowBox[{
       RowBox[{
        RowBox[{"onNegative", "[", "qmp2", "]"}], " ", "Tp2"}], "+", 
       RowBox[{
        RowBox[{"onPositive", "[", "qmp2", "]"}], " ", "Tp1"}]}], ")"}]}], 
    "-", 
    RowBox[{
     RowBox[{"onPositive", "[", "qmp2", "]"}], 
     FractionBox["Dm", 
      RowBox[{"2", " ", "pi"}]], " ", 
     RowBox[{"(", "wm1", ")"}], " ", 
     RowBox[{"(", 
      RowBox[{"pp1", "-", "pp2"}], ")"}]}]}]}]}]], "Text",
 CellChangeTimes->{3.628703796715478*^9, 3.628703829775539*^9}],

Cell[BoxData[
 RowBox[{"systemEquationsDA", " ", ":=", " ", 
  RowBox[{"{", "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{
     RowBox[{
      RowBox[{"Jm", " ", 
       RowBox[{"der", "[", 
        RowBox[{"der", "[", "thetamr1", "]"}], "]"}]}], " ", "+", " ", 
      RowBox[{"Bm", " ", 
       RowBox[{"der", "[", "thetamr1", "]"}]}]}], "  ", "==", " ", 
     RowBox[{"(", 
      RowBox[{"torg", " ", "-", " ", "tormr1"}], ")"}]}], ",", 
    "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{
      RowBox[{"Jm", " ", 
       RowBox[{"der", "[", "wmr1", "]"}]}], " ", "+", " ", 
      RowBox[{"Bm", " ", "wmr1"}]}], "  ", "==", " ", 
     RowBox[{"(", 
      RowBox[{"torg", " ", "-", " ", "tormr1"}], ")"}]}], ",", 
    "\[IndentingNewLine]", 
    RowBox[{"qmp2", "\[Equal]", 
     RowBox[{
      RowBox[{"(", 
       RowBox[{
        RowBox[{
         RowBox[{"onNegative", "[", "qmp2", "]"}], "rho2"}], "+", 
        RowBox[{
         RowBox[{"onPositive", "[", "qmp2", "]"}], "rho1"}]}], ")"}], 
      RowBox[{"(", 
       RowBox[{
        RowBox[{
         FractionBox["Dm", 
          RowBox[{"2", " ", "pi"}]], 
         RowBox[{"(", " ", "wmr1", ")"}]}], " ", "+", " ", 
        RowBox[{"Cim", "*", 
         RowBox[{"(", 
          RowBox[{"pp1", "-", "pp2"}], ")"}]}]}], ")"}]}]}], ",", 
    "\[IndentingNewLine]", 
    RowBox[{"dEp1", "\[Equal]", 
     RowBox[{
      RowBox[{"qmp1e", " ", "cp", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{
          RowBox[{"onNegative", "[", "qmp1e", "]"}], " ", "Tp1"}], "+", 
         RowBox[{
          RowBox[{"onPositive", "[", "qmp1e", "]"}], " ", "Tp2"}]}], ")"}]}], 
      "-", 
      RowBox[{
       RowBox[{"onPositive", "[", "qmp1e", "]"}], "tormr1", " ", "wmr1"}]}]}],
     ",", "\[IndentingNewLine]", 
    RowBox[{"dEp2", "\[Equal]", 
     RowBox[{
      RowBox[{"qmp2", " ", "cp", 
       RowBox[{"(", 
        RowBox[{
         RowBox[{
          RowBox[{"onNegative", "[", "qmp2", "]"}], " ", "Tp2"}], "+", 
         RowBox[{
          RowBox[{"onPositive", "[", "qmp2", "]"}], " ", "Tp1"}]}], ")"}]}], 
      "-", 
      RowBox[{
       RowBox[{"onPositive", "[", "qmp2", "]"}], "tormr1", " ", 
       "wmr1"}]}]}]}], "\[IndentingNewLine]", "\t", "}"}]}]], "Input",
 CellChangeTimes->{{3.524850724265625*^9, 3.524850724265625*^9}, {
   3.571903224566633*^9, 3.571903236734655*^9}, {3.5779562974972825`*^9, 
   3.577956423703501*^9}, {3.57795648347992*^9, 3.5779564933454847`*^9}, {
   3.577956816134947*^9, 3.5779568302647552`*^9}, {3.577957767610368*^9, 
   3.5779577781419706`*^9}, 3.577957863609859*^9, {3.5781111461206555`*^9, 
   3.5781111554625897`*^9}, {3.5781273950757246`*^9, 
   3.5781274254949446`*^9}, {3.626604378603088*^9, 3.6266044382640533`*^9}, {
   3.626604662032428*^9, 3.626604693302555*^9}, {3.6266047730805316`*^9, 
   3.626604820529276*^9}, {3.626604856429866*^9, 3.6266048940006227`*^9}, 
   3.626607899862183*^9, {3.626608641173307*^9, 3.626608673875577*^9}, {
   3.626608704628652*^9, 3.626608717389928*^9}, {3.6266087679999886`*^9, 
   3.626608772536442*^9}, {3.6266088411673045`*^9, 3.626608902761463*^9}, {
   3.626608946904877*^9, 3.626609017467098*^9}, {3.626609120804098*^9, 
   3.626609149715098*^9}, {3.626609284991098*^9, 3.626609287686098*^9}, {
   3.6266093808360977`*^9, 3.626609382648098*^9}, 3.626789081283904*^9, 
   3.626813166444628*^9, {3.626853380001712*^9, 3.6268534431423235`*^9}, {
   3.6268535164635167`*^9, 3.6268535179916043`*^9}, {3.6268537570642786`*^9, 
   3.6268537585183616`*^9}, {3.626854062275736*^9, 3.6268540744144297`*^9}, {
   3.626854373837556*^9, 3.6268543753686438`*^9}, {3.626854442638491*^9, 
   3.626854478095519*^9}, {3.6268554363173265`*^9, 3.6268555022790995`*^9}, {
   3.6272349563514795`*^9, 3.6272349818099356`*^9}, {3.627235911093087*^9, 
   3.627235913462223*^9}, {3.627236367789209*^9, 3.627236381178975*^9}, {
   3.627236509392308*^9, 3.6272365196108923`*^9}, {3.6272366001034966`*^9, 
   3.627236603817709*^9}, {3.62773277304503*^9, 3.6277328129528294`*^9}, {
   3.6277330790318766`*^9, 3.627733087843053*^9}, {3.6287038399685535`*^9, 
   3.6287038886716223`*^9}, {3.6287054247012653`*^9, 3.62870542835227*^9}, {
   3.6289418299516573`*^9, 3.628941837543668*^9}, {3.628942003474901*^9, 
   3.6289420068459063`*^9}, {3.6289544963717937`*^9, 
   3.6289545066938086`*^9}, {3.6289627795420523`*^9, 3.62896279966508*^9}, {
   3.628962839900137*^9, 3.628962844611144*^9}, {3.628962951956295*^9, 
   3.6289629548372993`*^9}, {3.630914412650628*^9, 3.630914467465109*^9}, {
   3.630931101653892*^9, 3.630931106617176*^9}, {3.630931151425739*^9, 
   3.63093116456149*^9}, {3.6309312313293085`*^9, 3.6309312452211037`*^9}, {
   3.630931305455549*^9, 3.630931321108444*^9}, {3.6309980434137416`*^9, 
   3.6309980806518717`*^9}}],

Cell["The boundarys", "Text"],

Cell[BoxData[
 RowBox[{
  RowBox[{"systemBoundaryEquations", " ", "=", " ", 
   RowBox[{"{", " ", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"pp1", " ", "==", " ", 
      RowBox[{"(", 
       RowBox[{"cp1", " ", "+", " ", 
        RowBox[{"Zcp1", " ", "dEp1"}]}], " ", ")"}]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"pp2", " ", "==", 
      RowBox[{"(", 
       RowBox[{"cp2", " ", "+", " ", 
        RowBox[{"Zcp2", " ", "dEp2"}]}], " ", ")"}]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"tormr1", "\[Equal]", 
      RowBox[{"cmr1", "+", 
       RowBox[{"wmr1", " ", "Zcmr1"}]}]}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.535370830684037*^9, 3.535370830684037*^9}, {
  3.572017824436248*^9, 3.5720178479275913`*^9}, {3.626609061441098*^9, 
  3.626609061923098*^9}, {3.6289545114458156`*^9, 3.6289545165178227`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"systemVariables", "=", " ", 
   RowBox[{"{", 
    RowBox[{
    "thetamr1", ",", "wmr1", ",", "qmp2", ",", "dEp1", ",", "dEp2", ",", 
     "pp1", ",", "pp2", ",", "tormr1"}], "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.524850716875*^9, 3.524850716875*^9}, {
   3.577956431479946*^9, 3.5779564393723974`*^9}, {3.577956859515428*^9, 
   3.5779568640126853`*^9}, {3.5779577901476574`*^9, 3.577957792222776*^9}, 
   3.5779578730333977`*^9, 3.5781111509651403`*^9, {3.626609178128098*^9, 
   3.626609189264098*^9}, {3.6266868991754274`*^9, 3.6266869012046304`*^9}, {
   3.6289545205788283`*^9, 3.628954527860839*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"variableLowLimits", "=", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"pp1", ",", "0"}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{"pp2", ",", "0"}], "}"}]}], "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.578505814681842*^9, 3.5785058445435495`*^9}, 
   3.578509359037567*^9, 3.626686631086085*^9, 3.6266866678460846`*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"expressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{"qmp1", "\[Equal]", 
     RowBox[{"-", "qmp2"}]}], "\[IndentingNewLine]", "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.577956890459198*^9, 3.5779569714248285`*^9}, {
   3.578111147599804*^9, 3.578111149042948*^9}, {3.6266044198372107`*^9, 
   3.626604453688596*^9}, {3.626604488745101*^9, 3.626604502243451*^9}, 
   3.6266045457538013`*^9, 3.626604589207146*^9, {3.6266046247527003`*^9, 
   3.6266046598352084`*^9}, {3.626608952152402*^9, 3.626608954681655*^9}, 
   3.6266865798930845`*^9, {3.626686949473457*^9, 3.626686951085618*^9}, {
   3.6268131265583467`*^9, 3.6268131397441006`*^9}}],

Cell[BoxData[
 RowBox[{"Compgen", "[", "file", "]"}]], "Input"]
}, Open  ]]
}, Open  ]]
},
WindowSize->{1008, 664},
WindowMargins->{{Automatic, 142}, {-8, Automatic}},
FrontEndVersion->"8.0 for Microsoft Windows (64-bit) (October 6, 2011)",
StyleDefinitions->"Default.nb"
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[CellGroupData[{
Cell[579, 22, 316, 5, 71, "Section",
 Evaluatable->False],
Cell[898, 29, 248, 4, 31, "Input"],
Cell[1149, 35, 719, 14, 31, "Input"],
Cell[1871, 51, 1670, 35, 172, "Input"],
Cell[3544, 88, 2363, 35, 233, "Text"],
Cell[CellGroupData[{
Cell[5932, 127, 43, 0, 36, "Subsection"],
Cell[5978, 129, 43, 0, 29, "Text"]
}, Open  ]],
Cell[CellGroupData[{
Cell[6058, 134, 41, 0, 36, "Subsection"],
Cell[6102, 136, 70, 0, 29, "Text"]
}, Open  ]],
Cell[CellGroupData[{
Cell[6209, 141, 46, 0, 36, "Subsection"],
Cell[6258, 143, 1656, 36, 178, "Input"],
Cell[7917, 181, 1180, 22, 112, "Input"]
}, Open  ]],
Cell[CellGroupData[{
Cell[9134, 208, 45, 0, 36, "Subsection"],
Cell[9182, 210, 42, 0, 29, "Text"],
Cell[9227, 212, 405, 11, 49, "Input"],
Cell[9635, 225, 132, 1, 29, "Text"],
Cell[9770, 228, 211, 4, 31, "Input"],
Cell[9984, 234, 661, 16, 87, "Input"],
Cell[10648, 252, 220, 5, 31, "Input"],
Cell[10871, 259, 163, 4, 31, "Input"],
Cell[CellGroupData[{
Cell[11059, 267, 169, 4, 31, "Input"],
Cell[11231, 273, 828, 11, 30, "Output"]
}, Open  ]],
Cell[12074, 287, 613, 13, 72, "Input"],
Cell[12690, 302, 1160, 36, 86, "Text"],
Cell[13853, 340, 4776, 100, 183, "Input"],
Cell[18632, 442, 29, 0, 29, "Text"],
Cell[18664, 444, 876, 21, 112, "Input"],
Cell[19543, 467, 650, 12, 31, "Input"],
Cell[20196, 481, 382, 10, 31, "Input"],
Cell[20581, 493, 700, 12, 72, "Input"],
Cell[21284, 507, 63, 1, 31, "Input"]
}, Open  ]]
}, Open  ]]
}
]
*)

(* End of internal cache information *)
